<template>
	<view class="content">
		<view class="nav_float">
			<u-navbar
				@leftClick="leftClick"
				:placeholder="true"
				:fixed="true"
				bgColor="transparent"
				:autoBack="true"
			>
			</u-navbar>
		</view>
		<view class="cont">
			<u-parse :content="content" :tagStyle="style"></u-parse>
		</view>
		<view class="button_box" v-if="content_id == 6" @click="gotopage('jiarujiahua')">
			<view class="buton">前往购卡</view>
		</view>
		<view class="zhanwei" v-if="content_id != 6"></view>
	</view>
</template>

<script>
	import HostConfig from '@/utils/host.js';
	import Host from '@/utils/api.js';
	export default {
			data() {
				return {
					content_id: '', // 成长计划才需要显示按钮
					content: '',
					style: {
						// 字符串的形式
						p: 'color: red;font-size:32rpx',
						// span: 'font-size: 30rpx',
						img: 'width:100%!important;vertical-align:middle;'
					}
				}
			},
			onLoad(data_id) {
				this.content_id = data_id.id;
				let that = this;
				uni.request({
					url: Host.ApiBanner.url, //仅为示例，并非真实接口地址。
					method: 'GET',
					data: {
						location: 'joinplan'
					},
					success: (res) => {			
						let zhensongImg = res.data.image;
						let hostUrl = HostConfig.service.host;
						var list = res.data.data;
						list.map((value, index) =>{
							if(value.location == 'banner' && value.id == data_id.id){	// 成长计划详情和联合众美详情
								that.content = value.content;
							}
						})	
						
					}
				});
			},
			methods:{
				leftClick(){
					uni.navigateBack({
						delta:1
					})
				},
				gotopage(param){
					if(param == 'jiarujiahua'){
						uni.navigateTo({
							url:'/pages/zhunxingfuwu/jiarujiahua/jiarujiahua'
						})
					}
				}
			}
		}
</script>

<style>
	page{
		background-color: #F3FBFF;
	}
	.content{
		width: 100%;
		overflow-x: hidden;
	}
	.nav_float{
		position: absolute;
		overflow-x:hidden;
	}
	.cont{
		margin-bottom: 20upx;
	}
	.button_box{
		
		
		padding-bottom: 0;
		padding-bottom: constant(safe-area-inset-bottom);  
		padding-bottom: env(safe-area-inset-bottom);  
	}
	.buton{
		width: 720upx;
		height: 106upx;
		background: #6CCBFF;
		border-radius: 6upx;
		display: flex;
		justify-content: center;
		align-items: center;
		
		margin-left: 24upx;
		/* position: relative;
		bottom: 100upx;
		left: 64upx; */
		
		
		font-size: 32upx;
		font-family: PingFangSC-Medium, PingFang SC;
		font-weight: 500;
		color: #FFFFFF;
		line-height: 44upx;
	}
	.zhanwei{
	padding-bottom: 0;
	padding-bottom: constant(safe-area-inset-bottom);  
	padding-bottom: env(safe-area-inset-bottom);  	
	}
</style>
